<?php

namespace app\controller\system;

use app\BaseController;
use think\response\Json;

class User extends BaseController
{
    public function lst(): Json
    {
        return $this->handle(function (){
            return $this->app->make(\app\model\User::class)->lst();
        });
    }

    public function detail(): Json
    {
        return $this->handle(function (){
            return $this->app->make(\app\model\User::class)->detail();
        });
    }
    public function save(): Json
    {
        return $this->handle(function (){
            return $this->app->make(\app\model\User::class)->saveData();
        });
    }

    public function update_state(): Json
    {
        return $this->handle(function (){
            return $this->app->make(\app\model\User::class)->updateState();
        });
    }

    public function delete(): Json
    {
        return $this->handle(function (){
            return $this->app->make(\app\model\User::class)->deleteData();
        });
    }

    public function update_balance(): Json
    {
        return $this->handle(function (){
            return $this->app->make(\app\model\User::class)->updateBalance();
        });
    }

    public function balance_lst()
    {
        return $this->handle(function (){
            return $this->app->make(\app\model\UserBalanceDetail::class)->lst();
        });
    }
}
